package testCollection;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.Set;


public class Test {
	public static void main(String[] args) {
		List<String> list = new ArrayList<String>();
		list.add("abc");
		list.add("def");
		list.add("www");
		
		for (int i = 0; i < list.size() ; i++) {
			System.out.println(list.get(i));
		}
		
		ListIterator<String> it2  = list.listIterator();
		
		Set<String> set = new HashSet<String>();
		set.add("abc");
		set.add("def");
		set.add("www");

		Iterator<String> it = set.iterator();
		while(it.hasNext()){
			String value = it.next();
			System.out.println(value);
		}
		
//		set.forEach((t)->System.out.println(t));
		set.forEach(System.out::println);
		
	}
}
